package string;
/**
 * boolean startsWith(String str)
 * boolean endsWith(String str)
 * 判断当前字符串是否是以给定字符串(str)开始或结束的
 * */
public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "www.tedu.cn";
        boolean star = str.startsWith("www");
        System.out.println(star);

        boolean end = str.endsWith(".cn");
        System.out.println(end);

        boolean star1 = str.startsWith("httl");
        System.out.println(star1);

        boolean end1 = str.endsWith(".pug");
        System.out.println(end1);
    }
}
